package com.yonyou.pmclouds.job;

import java.util.ServiceLoader;

public abstract class AbstractJobExecutor {
    /**
     * success
     */
    public static final ExecResult<String> SUCCESS = ExecResult.SUCCESS;
    /**
     * fail
     */
    public static final ExecResult<String> FAIL = ExecResult.FAIL;
    /**
     * fail retry
     */
    public static final ExecResult<String> FAIL_RETRY = ExecResult.FAIL_RETRY;
    public static final JobExecLogger logger = ServiceLoader.load(JobExecLogger.class).iterator().next();

    public abstract ExecResult<String> execute(String param) throws Exception;


    /**
     * init handler, invoked when JobThread init
     */
    public void init() {
    }


    /**
     * destroy handler, invoked when JobThread destroy
     */
    public void destroy() {
    }
}
